#include<iostream>
#include<string>
#include<map>
#define F(i,j,r) for(int i=j;i<=r;++i)

using namespace std;

string a;
string ans;
int M = -1;

map <  string, int > m;
int main() {
	cin >> a;
	cin >> a;
	F(i, 0, a.size() - 2)
	{
		m[a.substr(i, 2)]++;
	}

	for (auto&& p : m)
	{
		if (p.second > M)
		{
			M = p.second;
			ans = p.first.c_str();
		}
	}
	cout << ans << endl;
	return 0;
}